package com.qf.service.impl;

import com.qf.entity.OccupancyInfo;
import com.qf.entity.OccupancyInfoDTO;
import com.qf.mapper.OccupancyInfoMapper;
import com.qf.service.OccupancyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * @ClassName: OccupancyInfoServiceImpl
 * @Author: WangHao
 * @Date: 2025/4/28 15:44
 * @Description:
 * @Version: 1.0
 */
@Service
public class OccupancyInfoServiceImpl implements OccupancyInfoService {
    @Autowired
    private OccupancyInfoMapper occupancyInfoMapper;

    @Override
    public List<OccupancyInfo> findAll(OccupancyInfoDTO occupancyInfoDTO) {
        return occupancyInfoMapper.findAll(occupancyInfoDTO);
    }

    @Override
    public boolean delOccupancyInfoById(Integer id) {
        return occupancyInfoMapper.delOccupancyInfoById(id);
    }

    @Override
    public boolean delOccupancyInfoByIds(Integer[] ids) {
        return occupancyInfoMapper.delOccupancyInfoByIds(ids);
    }

    @Override
    public boolean updateLeaveTime(Integer id) {
        // 获取当前时间
        Date time = new Date();
        return occupancyInfoMapper.updateLeaveTime(id,time);
    }

}
